#include <bits/stdc++.h>
using namespace std;
int a[10010], n = 0;
void del()
{
	for(int i = 2; i <= n; i++)
		a[i-1] = a[i];
	n--;
	for(int i = 1; i <= n; i++)
		cout << a[i] << " ";
	cout << endl;
}
void pl(int x)
{
	for(int i = 2; i <= n; i++)
		a[i] = a[i-1];
	a[1] = x;
	for(int i = 1; i <= n; i++)
		cout << a[i] << " ";
	cout << endl;
}
int main()
{
	cout << "1 删除 2 添加" << endl;
	while(1)
	{
		int d;
		cin >> d;
		if(d == 1)
			del();
		if(d == 2){
			int u;
			cin >> u;
			pl(u);
		}
	}
	return 0;
}